Skip to content

fix(idp-provider): test-rp selects its JWKS key by token kid - #13789

Merged
dezren39 merged 1 commit into
mainfrom
lane/idp4/test-rp-multikid
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane/idp4/test-rp-multikid

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #13658 (Slice 5 live rollover follow-up).

Small correctness fix to the proof RP, found by the live rollover: examples/test-rp.rs hardcoded jwks.keys[0] as its verification key. In the overlap phase with the new key active, the token correctly carried the new kid — which sat at keys[1] — and the RP rejected it (id_token header alg/kid does not match JWKS). The provider was right; the RP's single-key assumption was the bug.

The RP now selects the JWKS entry by the token header's kid before verifying, as a real relying party does. Crate tests still 19/19 on the laptop; the fixed RP is re-run against the live overlap configuration as part of the rollover record on #13658.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The Slice 3 proof RP hardcoded jwks.keys[0] as the verification
key. During the Slice 5 live rollover's overlap phase with the
new key active, that check rejected a correctly signed token
("id_token header alg/kid does not match JWKS") even though the
provider's JWKS, signing, and userinfo verification were all
correct — keys[0] was the old key, the token carried the new kid.

The RP now does what a real relying party does: parse the token
header, find the JWKS entry whose kid matches, and verify
against that key. Found by the live rollover recorded on #13658;
crate tests still 19/19.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6c2738b6-9e3b-40f5-aa5e-4e47ec777ace
Commits

Reviewing files that changed from the base of the PR and between 62a81dd and 4eff22a.

Files selected for processing: 1

  • pkgs/idp-provider/examples/test-rp.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 333631f into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane/idp4/test-rp-multikid branch November 23, 2026 21:46
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant